package net.lucamasini.ricette.client.tipoingredienti.event;

import java.util.List;

import net.lucamasini.ricette.client.tipoingredienti.TipoIngredienteProxy;

import com.google.gwt.event.shared.EventHandler;
import com.google.gwt.event.shared.GwtEvent;

public class NewListaTipoIngredientiEvent extends GwtEvent<NewListaTipoIngredientiEvent.Handler> {

	public static interface Handler extends EventHandler {
		void onNewListaTipoIngredientiRequest(NewListaTipoIngredientiEvent event);
	}

	public final static Type<Handler> TYPE = new Type<NewListaTipoIngredientiEvent.Handler>();

	private final List<TipoIngredienteProxy> listaIngredienti;
	
	public NewListaTipoIngredientiEvent(List<TipoIngredienteProxy> listaIngredienti) {
		this.listaIngredienti = listaIngredienti;
	}

	@Override
	public Type<Handler> getAssociatedType() {
		return TYPE;
	}

	@Override
	protected void dispatch(Handler handler) {
		handler.onNewListaTipoIngredientiRequest(this);
	}

	public List<TipoIngredienteProxy> getListaTipoIngredienti() {
		return listaIngredienti;
	}
}
